import {request} from "./index";
export function getclass(pagenum,pagesize,sort) {
    return request({
        method: 'get',
        url: '/course/query',
        params: {
            pageNum:pagenum,
            pageSize:pagesize,
            sort:sort
        }
    })
}
export function getClassByid(cid,pagenum,pagesize,sort) {
    return request({
        method: 'get',
        url: '/course/query',
        params: {
            cId:cid,
            pageNum:pagenum,
            pageSize:pagesize,
            sort:sort
        }
    })
}
export function getClassByname(cname,pagenum,pagesize,sort) {
    return request({
        method: 'get',
        url: '/course/query',
        params: {
            cName:cname,
            pageNum:pagenum,
            pageSize:pagesize,
            sort:sort
        }
    })
}
export function classdelete(cId) {
    return request({
        method:'post',
        url:'/course/delete/'+cId

    })
}
export function addclass(form) {
    return request({
        method:'post',
        url:'/course/add',
        params:{
            cName:form.cName,
            cTime:form.cTime,
            teacher:form.teacher
        }
    })
}
export function updateclass(form) {
    return request({
        method:'post',
        url:'/course/update',
        params:{
            cId:form.cId,
            cName:form.cName,
            cTime:form.cTime,
            teacher:form.teacher
        }
    })
}
export function getScore2(cId,sort) {
    return request({
        method:'get',
        url:'/grade/getScore2',
        params:{
            cId:cId,
            sort:sort
        }
    })
}
